home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 11549 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  748 b 

  1. From: _GOYRA_@msn.com (David Byrden)
  2. Subject: RE: Help, C++ '&' dereferencer
  3. Date: 15 Mar 96 04:44:56 -0800
  4. References: <4i153m$pgf@bignews.shef.ac.uk>
  5. Message-ID: <00001a81+0000ad51@msn.com>
  6. Path: news.msn.com!msn.com
  7. Newsgroups: comp.lang.c++
  8. Organization: The Microsoft Network (msn.com)
  9.  
  10.  
  11. >> can anyone please simply explain to me what the  &  sign ( or 
  12. 'dereferencer' I believe)
  13. >> is doing in the following command line where 'value' should end up 
  14. as 1 or 0.
  15. >>    value=((inportb(0x1B4) & 0x20)>>5);
  16.  
  17.  
  18.     The ampersand is, in this context, the bitwise boolean AND operator. 
  19. It is there to mask out bit 5. The designers of C were apparently 
  20. awarded brownie points for assigning multiple meanings to keywords 
  21. and operators.
  22.  
  23.  
  24.                             David
  25.  
  26.